//
//  ViewController.m
//  图片拉伸
//
//  Created by J on 16/3/4.
//  Copyright © 2016年 J. All rights reserved.
//

#import "ViewController.h"
#import "UIImage+Extension.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    UIImageView* imageView = [[UIImageView alloc]init];
    imageView.frame = CGRectMake(50, 50, 250, 250);
    [self.view addSubview:imageView];
    UIImage* image = [UIImage resizableImage:@"chat_send_press_pic"];

    //
    //
//   image =  [image resizableImageWithCapInsets:UIEdgeInsetsMake(10, 30, 50, 40) resizingMode:UIImageResizingModeStretch];//返回一份利用本身的图片加工新图片 但是原图本身并没有改变
    
//    image =  [image stretchableImageWithLeftCapWidth:image.size.width*0.5 topCapHeight:image.size.height*0.5];
    
    //UIImageResizingModeStretch直接拉伸  UIImageResizingModeTile平铺拉伸
    imageView.image = image;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
